
import java.text.SimpleDateFormat;
import java.text.DecimalFormat;
import java.util.Calendar;

public class Global 
{
	public static User currentUser;
	private static boolean runningAsApplet;
	public static final	SimpleDateFormat DATE_FORMAT= new SimpleDateFormat("MMM dd");
	public static final DecimalFormat PERCENTAGE_FORMAT= new DecimalFormat("###.00%");
	public static final DecimalFormat TIME_FORMAT= new DecimalFormat("###.000s");
	
	
	private Global()
	{
		
	}
	
	public static boolean isApplet()
	{
		return runningAsApplet;
	}
	
	protected static void markAsApplet()
	{
		runningAsApplet= true;
	}
	
	protected static void markAsApp()
	{
		runningAsApplet= false;
	}
	
	public static boolean sameDate(Calendar date1, Calendar date2)
	{
		boolean sameDate= date1.get(Calendar.DAY_OF_YEAR)==date2.get(Calendar.DAY_OF_YEAR);
		boolean sameYear= date1.get(Calendar.YEAR)==date2.get(Calendar.YEAR);
		return sameDate&&sameYear;
	}
	
	public static void rollDate(Calendar date, boolean up)
	{
		if(up) date.add(Calendar.DAY_OF_YEAR, 1);
		else date.add(Calendar.DAY_OF_YEAR, -1);
	}
	

}
